﻿using System;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace MugenMvvmToolkit.Models
{
    /// <summary>
    ///     Represents the enum that uses by notification collection.
    /// </summary>
    [Flags]
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum NotificationCollectionCountType : byte
    {
        /// <summary>
        ///     Both methods of interfaces return the real value of count.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 1,

        /// <summary>
        ///     The ICollection interface returns the notification count.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        CollectionIntefaceReturnsNotificationCount = 2,

        /// <summary>
        ///     The ICollection{T} interface returns the notification count.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        GenericCollectionInterfaceReturnsNotificationCount = 4,

        /// <summary>
        ///     The flag indicates that notification count will be returned only in UI thread.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        OnlyInUiThread = 8
    }

    /// <summary>
    ///     Specifies the execution mode.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum ExecutionType : byte
    {
        /// <summary>
        ///     Executes an action in the current thread.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 0,

        /// <summary>
        ///     Executes an action in Ui thread synchronous.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        SynchronousInUi = 1,

        /// <summary>
        ///     Executes an action asynchronous.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Asynchronous = 2,

        /// <summary>
        ///     Executes an action in Ui thread asynchronous.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        AsynchronousInUi = 3
    }

    /// <summary>
    ///     Specifies the listen mode.
    /// </summary>
    [Flags]
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum ListenType : byte
    {
        /// <summary>
        ///     None listen.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 0,

        /// <summary>
        ///    Child view model listens parent.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Parent = 1,

        /// <summary>
        ///     Parent view model listens child view model.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Child = 2,

        /// <summary>
        /// Parent view model listens child view model and child view model listens parent.
        /// </summary>
        ParentAndChild = Parent | Child
    }

    /// <summary>
    ///     Specifies the hadnle mode.
    /// </summary>
    [Flags]
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum HandleType : byte
    {
        /// <summary>
        ///     None handle
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 0,

        /// <summary>
        ///     Handles and processes a message.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Handle = 1,

        /// <summary>
        ///     Handles and notifies listeners about a message.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        NotifyListeners = 2,

        /// <summary>
        ///     Handles and processes a message and notifies listeners about the message.
        /// </summary>
        HandleAndNotifyListeners = Handle | NotifyListeners
    }

    /// <summary>
    ///     Represents the audit action information.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum AuditAction : byte
    {
        /// <summary>
        ///     Create action.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Created = 1,

        /// <summary>
        ///     Initialize action
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Initialized = 2,

        /// <summary>
        ///     Dispose action.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Disposed = 4,

        /// <summary>
        ///     Finalize action.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Finalized = 8
    }

    /// <summary>
    ///     Specifies the buttons that are displayed on a message box. Used as an argument of the IMessageBox.Show methods.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum MessageBoxButtons : byte
    {
        /// <summary>
        ///     Ok button.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Ok = 1,

        /// <summary>
        ///     Ok and cancel buttons.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        OkCancel = 2,

        /// <summary>
        ///     Yes and no buttons.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        YesNo = 3,

        /// <summary>
        ///     Yes, no and cancel buttons.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        YesNoCancel = 4,

        /// <summary>
        ///     Abort, retry and ignore buttons.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        AbortRetryIgnore = 5,

        /// <summary>
        ///     Retry and cancel buttons.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        RetryCancel = 6
    }

    /// <summary>
    ///     Specifies the icon that is displayed by a message box.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum MessageBoxImages : byte
    {
        /// <summary>
        ///     Asterisk image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Asterisk = 1,

        /// <summary>
        ///     Error image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Error = 2,

        /// <summary>
        ///     Exclamation image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Exclamation = 3,

        /// <summary>
        ///     Hand image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Hand = 4,

        /// <summary>
        ///     Information image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Information = 5,

        /// <summary>
        ///     None image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 6,

        /// <summary>
        ///     Question image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Question = 7,

        /// <summary>
        ///     Stop image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Stop = 8,

        /// <summary>
        ///     Warning image.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Warning = 9
    }

    /// <summary>
    ///     Specifies which message box button that a user clicks.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum MessageBoxResults : byte
    {
        /// <summary>
        ///     Ok result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Ok = 1,

        /// <summary>
        ///     Cancel result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Cancel = 2,

        /// <summary>
        ///     No result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        No = 3,

        /// <summary>
        ///     None result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 4,

        /// <summary>
        ///     Yes result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Yes = 5,

        /// <summary>
        ///     Abort result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Abort = 6,

        /// <summary>
        ///     Retry result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Retry = 7,

        /// <summary>
        ///     Ignore result.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Ignore = 8
    }

    /// <summary>
    ///     Represents the enum that uses by <c>IRelayCommand</c> to call the <c>Execute</c> method.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum CommandExecutionType : byte
    {
        /// <summary>
        ///     Call the <c>Execute</c> method without checks.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        None = 1,

        /// <summary>
        ///     Call the <c>CanExecute</c> method before call the <c>Execute</c> method.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        CanExecuteBeforeExecute = 2,

        /// <summary>
        ///     Call the <c>CanExecute</c> method before call the <c>Execute</c> method and throw an exception if needed.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        CanExecuteBeforeExecuteWithException = 3
    }

#if !TASKSUPPORT
    /// <summary>
    /// Represents the operation result statuses.
    /// </summary>
#if WPF
    [Serializable]
#endif
    [DataContract]
    public enum OperationStatus : byte
    {
        /// <summary>
        /// The operation is running but has not yet completed.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Running = 1,

        /// <summary>
        /// The operation completed execution successfully.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Success = 2,

        /// <summary>
        /// The operation completed due to an unhandled exception.
        /// </summary>
        [XmlEnum]
        [EnumMember]
        Faulted = 3
    }
#endif

}